package com.zlsy.learning.leetcode.arraycorrelation.array1450;

/**
 * @author zhouliang
 * @date 2020/7/9 21:33
 */
public class BusyStudent {
    private static int busyStudent(int[] startTime, int[] endTime, int queryTime) {
        int length = startTime.length;
        int count = 0;
        for (int i = 0; i < length; i++) {
            int a = startTime[i];
            int b = endTime[i];
            if (queryTime >= a && queryTime <= b) {
                count++;
            }
        }
        return count;
    }

    public static void main(String[] args) {
        int[] startTime = new int[]{9, 8, 7, 6, 5, 4, 3, 2, 1};
        int[] endTime = new int[]{10, 10, 10, 10, 10, 10, 10, 10, 10};
        int queryTime = 5;
//        int[] startTime = new int[]{1, 2, 3};
//        int[] endTime = new int[]{3, 2, 7};
//        int queryTime = 4;
        int i = busyStudent(startTime, endTime, queryTime);
        System.out.println(i);
    }
}
